import socketio

sio = socketio.Client()


class MyCustomNamespace(socketio.ClientNamespace):
    def on_connect(self):
        pass

    def on_disconnect(self):
        pass

    def on_my_event(self, data):
        self.emit('my_response', data)


sio.register_namespace(MyCustomNamespace('/test2'))

if __name__ == '__main__':
    sio.connect("http://127.0.0.1:5000", namespaces=['/test2'])
    sio.wait()
